<template>
	<view class="select-industry-layout">
		<view class="select-industry-item" v-for="item in dataList" :key="item.code" @tap="didSelectItem(item)">
			<text>{{item.name}}</text>
		</view>
	</view>
</template>

<script setup>
	import { onLoad } from '@dcloudio/uni-app'
	import { ref } from 'vue'
	import { getSystemParams } from '@/common/api/api.js'
	
	const dataList = ref([])
	
	//获取行业列表数据
	const queryList = async ()=>{
		const res = await getSystemParams({categoryCode:'MccCode'})
		dataList.value = res.result
	}
	// 选择行业
	const didSelectItem = (item)=>{
		uni.$emit('selectIndustryResult',item)
		uni.navigateBack()
	}
	onLoad(()=>{
		queryList()
	})
	
</script>

<style lang="scss" scoped>
.select-industry-layout{
	padding: 20rpx;
	.select-industry-item{
		background-color: #ffffff;
		padding: 30rpx;
		border-radius: 16rpx;
		margin-bottom: 20rpx;
	}
}
</style>
